package cn.com.cym.gamezao.entity.demo;

import cn.com.cym.gamezao.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import javax.persistence.*;
import java.io.Serializable;

@Getter
@Setter
@Accessors(chain = true)
@NoArgsConstructor
@Entity
@Table(name ="x_single_child",uniqueConstraints=@UniqueConstraint(columnNames="father_id"))
@ApiModel(description = "子类")
public class SingleChild extends BaseEntity implements Serializable {

    private static final long serialVersionUID = -5023396836814906460L;

    private String code;

    private String name;

    @JoinColumn(name = "father_id")
    @OneToOne
    //@JsonIgnore
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Father father;
}
